home *** CD-ROM | disk | FTP | other *** search
/ Champak 145 / (Vol 145) Dec 21 2011.iso / Games / Debora.swf / scripts / frame_111 / DoAction_2.as next >
Encoding:
Text File  |  2011-12-21  |  20.1 KB  |  563 lines

  1. function clear_ini()
  2. {
  3.    _root.model_mc.top1_mc.gotoAndStop(1);
  4.    _root.model_mc.top2_mc.gotoAndStop(1);
  5.    _root.model_mc.top3_mc.gotoAndStop(1);
  6.    _root.model_mc.bot2_mc.gotoAndStop(1);
  7.    _root.model_mc.bot1_mc.gotoAndStop(1);
  8.    _root.model_mc.shoes_mc.gotoAndStop(1);
  9.    _root.model_mc.jew01_mc.gotoAndStop(1);
  10.    _root.model_mc.jew02_mc.gotoAndStop(1);
  11.    _root.model_mc.jew03_mc.gotoAndStop(1);
  12.    _root.model_mc.eye_mc.gotoAndStop(1);
  13.    _root.model_mc.hair_mc.gotoAndStop(1);
  14.    _root.model_mc.yaodai_mc.gotoAndStop(1);
  15.    _root.model_mc.cap_mc.gotoAndStop(1);
  16.    _root.model_mc.bag_mc.gotoAndStop(1);
  17.    _root.model_mc.waitao_mc.gotoAndStop(1);
  18.    _root.model_mc.kuwa_mc.gotoAndStop(1);
  19.    _root.model_mc.glass_mc.gotoAndStop(1);
  20.    _root.model_mc.tools5_mc.underwear1_mc._visible = true;
  21.    _root.model_mc.tools5_mc.underwear2_mc._visible = true;
  22.    var _loc2_ = 1;
  23.    while(_loc2_ < 22)
  24.    {
  25.       _root["on_clothing" + _loc2_]._visible = true;
  26.       _root["on_clothing" + _loc2_] = undefined;
  27.       _root.model_mc["tools" + _loc2_ + "_mc"].gotoAndStop(1);
  28.       _loc2_ = _loc2_ + 1;
  29.    }
  30. }
  31. function to_initialize_fun(_mc, y0)
  32. {
  33.    _mc.xp = 0;
  34.    _mc.yp = 0;
  35.    _mc.onEnterFrame = function()
  36.    {
  37.       this.yp = this.yp * 0.45 + (y0 - this._y) * 0.1;
  38.       this._y += this.yp;
  39.       if(Math.abs(this.yp) < 0.1)
  40.       {
  41.          this._y = y0;
  42.          delete this.onEnterFrame;
  43.       }
  44.    };
  45. }
  46. function make_fun()
  47. {
  48.    for(var _loc4_ in this)
  49.    {
  50.       if(typeof this[_loc4_] == "movieclip")
  51.       {
  52.          if(this[_loc4_]._name.substr(0,5) == "tools")
  53.          {
  54.             this[_loc4_].onRelease = function()
  55.             {
  56.                var _loc4_ = Number(this._name.substr(5,2));
  57.                var _loc3_ = 1;
  58.                while(_loc3_ <= 7)
  59.                {
  60.                   _root.to_initialize_fun(_root.tool_mask["thing_menu" + _loc3_],0);
  61.                   _root["tools0" + _loc3_].gotoAndStop(1);
  62.                   _loc3_ = _loc3_ + 1;
  63.                }
  64.                _root.to_initialize_fun(_root.tool_mask["thing_menu" + _loc4_],140);
  65.                this.gotoAndStop(2);
  66.             };
  67.          }
  68.          if(this[_loc4_]._name.substr(0,3) == "jew")
  69.          {
  70.             this[_loc4_].onRelease = function()
  71.             {
  72.                this.gotoAndStop(2);
  73.                _root.fair_menu.gotoAndStop(2);
  74.                _root.hair_btn.gotoAndStop(1);
  75.             };
  76.          }
  77.          if(this[_loc4_]._name.substr(0,4) == "hair")
  78.          {
  79.             this[_loc4_].onRelease = function()
  80.             {
  81.                this.gotoAndStop(2);
  82.                _root.fair_menu.gotoAndStop(1);
  83.                _root.jew_btn.gotoAndStop(1);
  84.             };
  85.          }
  86.          if(this[_loc4_]._name.substr(0,3) == "btn")
  87.          {
  88.             this[_loc4_].onRelease = function()
  89.             {
  90.                gotoAndStop(110, this.n);
  91.             };
  92.             this[_loc4_].onRollOver = function()
  93.             {
  94.                this.gotoAndStop(2);
  95.             };
  96.             this[_loc4_].onRollOut = function()
  97.             {
  98.                this.gotoAndStop(1);
  99.             };
  100.          }
  101.       }
  102.    }
  103. }
  104. function girl(x1, y1, s)
  105. {
  106.    if(this.model_mc.x0 and this.model_mc.y0)
  107.    {
  108.       this.model_mc._x = this.model_mc.x0 + x1;
  109.       this.model_mc._y = this.model_mc.y0 + y1;
  110.       this.model_mc._xscale = this.model_mc._yscale = s;
  111.       this.model_mc._rotation = 0;
  112.    }
  113.    trace(this.model_mc._x);
  114. }
  115. function third_ch_ini()
  116. {
  117.    for(var _loc4_ in this)
  118.    {
  119.       if(typeof this[_loc4_] == "movieclip" and this[_loc4_]._name.substr(0,1) == "a")
  120.       {
  121.          this[_loc4_].onRelease = function()
  122.          {
  123.             s1_sd();
  124.             if(this != _root.on_clothing1 and this != _root.on_clothing2 and this != _root.on_clothing3 and this != _root.on_clothing4 and this != _root.on_clothing5 and this != _root.on_clothing6)
  125.             {
  126.                if(this._name.substr(0,2) == "a1")
  127.                {
  128.                   var _loc3_ = Number(this._name.substr(2,2)) + 1;
  129.                   if(_root.on_clothing1 != undefined)
  130.                   {
  131.                      _root.on_clothing1._visible = true;
  132.                      _root.on_clothing1 = undefined;
  133.                   }
  134.                   if(_root.on_clothing2 != undefined)
  135.                   {
  136.                      _root.on_clothing2._visible = true;
  137.                      _root.on_clothing2 = undefined;
  138.                      _root.model_mc.top2_mc.gotoAndStop(1);
  139.                   }
  140.                   if(_root.on_clothing3 != undefined)
  141.                   {
  142.                      _root.on_clothing3._visible = true;
  143.                      _root.on_clothing3 = undefined;
  144.                      _root.model_mc.bot1_mc.gotoAndStop(1);
  145.                   }
  146.                   if(_root.on_clothing4 != undefined)
  147.                   {
  148.                      _root.on_clothing4._visible = true;
  149.                      _root.on_clothing4 = undefined;
  150.                      _root.model_mc.top2_mc.gotoAndStop(1);
  151.                   }
  152.                   if(_root.on_clothing5 != undefined)
  153.                   {
  154.                      _root.on_clothing5._visible = true;
  155.                      _root.on_clothing5 = undefined;
  156.                      _root.model_mc.bot2_mc.gotoAndStop(1);
  157.                   }
  158.                   this._visible = false;
  159.                   _root.on_clothing1 = this;
  160.                   _root.model_mc.top1_mc.gotoAndStop(_loc3_);
  161.                   _root.model_mc.tools5_mc.underwear1_mc._visible = false;
  162.                   _root.model_mc.tools5_mc_.underwear2_mc._visible = false;
  163.                }
  164.                if(this._name.substr(0,2) == "a2")
  165.                {
  166.                   _loc3_ = Number(this._name.substr(2,2)) + 1;
  167.                   if(_root.on_clothing1 != undefined)
  168.                   {
  169.                      _root.on_clothing1._visible = true;
  170.                      _root.on_clothing1 = undefined;
  171.                      _root.model_mc.top1_mc.gotoAndStop(1);
  172.                      _root.model_mc.tools5_mc.underwear2_mc._visible = true;
  173.                   }
  174.                   if(_root.on_clothing4 != undefined)
  175.                   {
  176.                      _root.on_clothing4._visible = true;
  177.                      _root.on_clothing4 = undefined;
  178.                      _root.model_mc.top3_mc.gotoAndStop(1);
  179.                      _root.model_mc.tools5_mc.underwear2_mc._visible = true;
  180.                   }
  181.                   if(_root.on_clothing2 != undefined)
  182.                   {
  183.                      _root.on_clothing2._visible = true;
  184.                      _root.on_clothing2 = undefined;
  185.                   }
  186.                   this._visible = false;
  187.                   _root.on_clothing2 = this;
  188.                   _root.model_mc.top2_mc.gotoAndStop(_loc3_);
  189.                   _root.model_mc.tools5_mc.underwear1_mc._visible = false;
  190.                }
  191.                if(this._name.substr(0,2) == "a3")
  192.                {
  193.                   _loc3_ = Number(this._name.substr(2,2)) + 1;
  194.                   if(_root.on_clothing1 != undefined)
  195.                   {
  196.                      _root.on_clothing1._visible = true;
  197.                      _root.on_clothing1 = undefined;
  198.                      _root.model_mc.top1_mc.gotoAndStop(1);
  199.                      _root.model_mc.tools5_mc.underwear1_mc._visible = true;
  200.                   }
  201.                   if(_root.on_clothing3 != undefined)
  202.                   {
  203.                      _root.on_clothing3._visible = true;
  204.                      _root.on_clothing3 = undefined;
  205.                   }
  206.                   if(_root.on_clothing5 != undefined)
  207.                   {
  208.                      _root.on_clothing5._visible = true;
  209.                      _root.on_clothing5 = undefined;
  210.                      _root.model_mc.bot2_mc.gotoAndStop(1);
  211.                      _root.model_mc.tools5_mc.underwear1_mc._visible = true;
  212.                   }
  213.                   this._visible = false;
  214.                   _root.on_clothing3 = this;
  215.                   _root.model_mc.bot1_mc.gotoAndStop(_loc3_);
  216.                   _root.model_mc.tools5_mc.underwear2_mc._visible = false;
  217.                }
  218.                if(this._name.substr(0,2) == "a4")
  219.                {
  220.                   _loc3_ = Number(this._name.substr(2,2)) + 1;
  221.                   if(_root.on_clothing1 != undefined)
  222.                   {
  223.                      _root.on_clothing1._visible = true;
  224.                      _root.on_clothing1 = undefined;
  225.                      _root.model_mc.top1_mc.gotoAndStop(1);
  226.                      _root.model_mc.tools5_mc.underwear2_mc._visible = true;
  227.                   }
  228.                   if(_root.on_clothing2 != undefined)
  229.                   {
  230.                      _root.on_clothing2._visible = true;
  231.                      _root.on_clothing2 = undefined;
  232.                      _root.model_mc.top2_mc.gotoAndStop(1);
  233.                      _root.model_mc.tools5_mc.underwear2_mc._visible = true;
  234.                   }
  235.                   if(_root.on_clothing4 != undefined)
  236.                   {
  237.                      _root.on_clothing4._visible = true;
  238.                      _root.on_clothing4 = undefined;
  239.                   }
  240.                   this._visible = false;
  241.                   _root.on_clothing4 = this;
  242.                   _root.model_mc.top3_mc.gotoAndStop(_loc3_);
  243.                   _root.model_mc.tools5_mc.underwear1_mc._visible = false;
  244.                }
  245.                if(this._name.substr(0,2) == "a5")
  246.                {
  247.                   _loc3_ = Number(this._name.substr(2,2)) + 1;
  248.                   if(_root.on_clothing1 != undefined)
  249.                   {
  250.                      _root.on_clothing1._visible = true;
  251.                      _root.on_clothing1 = undefined;
  252.                      _root.model_mc.top1_mc.gotoAndStop(1);
  253.                      _root.model_mc.tools5_mc.underwear1_mc._visible = true;
  254.                   }
  255.                   if(_root.on_clothing5 != undefined)
  256.                   {
  257.                      _root.on_clothing5._visible = true;
  258.                      _root.on_clothing5 = undefined;
  259.                   }
  260.                   if(_root.on_clothing3 != undefined)
  261.                   {
  262.                      _root.on_clothing3._visible = true;
  263.                      _root.on_clothing3 = undefined;
  264.                      _root.model_mc.bot1_mc.gotoAndStop(1);
  265.                      _root.model_mc.tools5_mc.underwear1_mc._visible = true;
  266.                   }
  267.                   this._visible = false;
  268.                   _root.on_clothing5 = this;
  269.                   _root.model_mc.bot2_mc.gotoAndStop(_loc3_);
  270.                   _root.model_mc.tools5_mc.underwear2_mc._visible = false;
  271.                }
  272.                if(this._name.substr(0,2) == "a9")
  273.                {
  274.                   _loc3_ = Number(this._name.substr(2,2)) + 1;
  275.                   if(_root.on_clothing10 != undefined)
  276.                   {
  277.                      _root.on_clothing10._visible = true;
  278.                      _root.on_clothing10 = undefined;
  279.                   }
  280.                   this._visible = false;
  281.                   _root.on_clothing10 = this;
  282.                   _root.model_mc.shoes_mc.gotoAndStop(_loc3_);
  283.                }
  284.                if(this._name.substr(0,2) == "aj")
  285.                {
  286.                   _loc3_ = Number(this._name.substr(2,2)) + 1;
  287.                   if(_root.on_clothing5 != undefined)
  288.                   {
  289.                      _root.on_clothing5._visible = true;
  290.                      _root.on_clothing5 = undefined;
  291.                   }
  292.                   this._visible = false;
  293.                   _root.on_clothing5 = this;
  294.                   _root.model_mc.jew01_mc.gotoAndStop(_loc3_);
  295.                }
  296.                if(this._name.substr(0,2) == "a6")
  297.                {
  298.                   _loc3_ = Number(this._name.substr(2,2)) + 1;
  299.                   if(_root.on_clothing6 != undefined)
  300.                   {
  301.                      _root.on_clothing6._visible = true;
  302.                      _root.on_clothing6 = undefined;
  303.                   }
  304.                   this._visible = false;
  305.                   _root.on_clothing6 = this;
  306.                   _root.model_mc.jew02_mc.gotoAndStop(_loc3_);
  307.                }
  308.                if(this._name.substr(0,2) == "a7")
  309.                {
  310.                   _loc3_ = Number(this._name.substr(2,2)) + 1;
  311.                   if(_root.on_clothing7 != undefined)
  312.                   {
  313.                      _root.on_clothing7._visible = true;
  314.                      _root.on_clothing7 = undefined;
  315.                   }
  316.                   this._visible = false;
  317.                   _root.on_clothing7 = this;
  318.                   _root.model_mc.bag_mc.gotoAndStop(_loc3_);
  319.                }
  320.                if(this._name.substr(0,2) == "a8")
  321.                {
  322.                   _loc3_ = Number(this._name.substr(2,2)) + 1;
  323.                   if(_root.on_clothing8 != undefined)
  324.                   {
  325.                      _root.on_clothing8._visible = true;
  326.                      _root.on_clothing8 = undefined;
  327.                   }
  328.                   this._visible = false;
  329.                   _root.on_clothing8 = this;
  330.                   _root.model_mc.cap_mc.gotoAndStop(_loc3_);
  331.                }
  332.                if(this._name.substr(0,2) == "aw")
  333.                {
  334.                   _loc3_ = Number(this._name.substr(2,2)) + 1;
  335.                   if(_root.on_clothing9 != undefined)
  336.                   {
  337.                      _root.on_clothing9._visible = true;
  338.                      _root.on_clothing9 = undefined;
  339.                   }
  340.                   this._visible = false;
  341.                   _root.on_clothing9 = this;
  342.                   _root.model_mc.waitao_mc.gotoAndStop(_loc3_);
  343.                }
  344.                if(this._name.substr(0,2) == "ay")
  345.                {
  346.                   _loc3_ = Number(this._name.substr(2,2)) + 1;
  347.                   if(_root.on_clothing11 != undefined)
  348.                   {
  349.                      _root.on_clothing11._visible = true;
  350.                      _root.on_clothing11 = undefined;
  351.                   }
  352.                   this._visible = false;
  353.                   _root.on_clothing11 = this;
  354.                   _root.model_mc.yaodai_mc.gotoAndStop(_loc3_);
  355.                }
  356.                if(this._name.substr(0,2) == "ak")
  357.                {
  358.                   _loc3_ = Number(this._name.substr(2,2)) + 1;
  359.                   if(_root.on_clothing12 != undefined)
  360.                   {
  361.                      _root.on_clothing12._visible = true;
  362.                      _root.on_clothing12 = undefined;
  363.                   }
  364.                   this._visible = false;
  365.                   _root.on_clothing12 = this;
  366.                   _root.model_mc.jew03_mc.gotoAndStop(_loc3_);
  367.                }
  368.             }
  369.          };
  370.       }
  371.    }
  372. }
  373. function reset_one()
  374. {
  375.    for(var _loc3_ in _root.model_mc)
  376.    {
  377.       if(typeof _root.model_mc[_loc3_] == "movieclip")
  378.       {
  379.          _root.model_mc[_loc3_].enabled = true;
  380.          if(_root.model_mc[_loc3_]._name.substr(0,3) == "cap")
  381.          {
  382.             _root.model_mc[_loc3_].onRelease = function()
  383.             {
  384.                this.gotoAndStop(1);
  385.                _root.on_clothing8._visible = true;
  386.                _root.on_clothing8 = undefined;
  387.             };
  388.          }
  389.          if(_root.model_mc[_loc3_]._name.substr(0,4) == "top1")
  390.          {
  391.             _root.model_mc[_loc3_].onRelease = function()
  392.             {
  393.                this.gotoAndStop(1);
  394.                _root.on_clothing1._visible = true;
  395.                _root.on_clothing1 = undefined;
  396.                _root.model_mc.tools5_mc.underwear1_mc._visible = true;
  397.                _root.model_mc.tools5_mc.underwear2_mc._visible = true;
  398.             };
  399.          }
  400.          if(_root.model_mc[_loc3_]._name.substr(0,4) == "top2")
  401.          {
  402.             _root.model_mc[_loc3_].onRelease = function()
  403.             {
  404.                this.gotoAndStop(1);
  405.                _root.on_clothing2._visible = true;
  406.                _root.on_clothing2 = undefined;
  407.                _root.model_mc.tools5_mc.underwear1_mc._visible = true;
  408.             };
  409.          }
  410.          if(_root.model_mc[_loc3_]._name.substr(0,4) == "bot1")
  411.          {
  412.             _root.model_mc[_loc3_].onRelease = function()
  413.             {
  414.                this.gotoAndStop(1);
  415.                _root.on_clothing3._visible = true;
  416.                _root.on_clothing3 = undefined;
  417.                _root.model_mc.tools5_mc.underwear2_mc._visible = true;
  418.             };
  419.          }
  420.          if(_root.model_mc[_loc3_]._name.substr(0,4) == "shoe")
  421.          {
  422.             _root.model_mc[_loc3_].onRelease = function()
  423.             {
  424.                this.gotoAndStop(1);
  425.                _root.on_clothing4._visible = true;
  426.                _root.on_clothing4 = undefined;
  427.             };
  428.          }
  429.          if(_root.model_mc[_loc3_]._name.substr(0,5) == "jew01")
  430.          {
  431.             _root.model_mc[_loc3_].onRelease = function()
  432.             {
  433.                this.gotoAndStop(1);
  434.                _root.on_clothing5._visible = true;
  435.                _root.on_clothing5 = undefined;
  436.             };
  437.          }
  438.          if(_root.model_mc[_loc3_]._name.substr(0,5) == "jew02")
  439.          {
  440.             _root.model_mc[_loc3_].onRelease = function()
  441.             {
  442.                this.gotoAndStop(1);
  443.                _root.on_clothing6._visible = true;
  444.                _root.on_clothing6 = undefined;
  445.             };
  446.          }
  447.          if(_root.model_mc[_loc3_]._name.substr(0,3) == "bag")
  448.          {
  449.             _root.model_mc[_loc3_].onRelease = function()
  450.             {
  451.                this.gotoAndStop(1);
  452.                _root.on_clothing7._visible = true;
  453.                _root.on_clothing7 = undefined;
  454.             };
  455.          }
  456.          if(_root.model_mc[_loc3_]._name.substr(0,5) == "waita")
  457.          {
  458.             _root.model_mc[_loc3_].onRelease = function()
  459.             {
  460.                this.gotoAndStop(1);
  461.                _root.on_clothing9._visible = true;
  462.                _root.on_clothing9 = undefined;
  463.             };
  464.          }
  465.          if(_root.model_mc[_loc3_]._name.substr(0,5) == "jew04")
  466.          {
  467.             _root.model_mc[_loc3_].onRelease = function()
  468.             {
  469.                this.gotoAndStop(1);
  470.                _root.on_clothing21._visible = true;
  471.                _root.on_clothing21 = undefined;
  472.             };
  473.          }
  474.          if(_root.model_mc[_loc3_]._name.substr(0,5) == "yaoda")
  475.          {
  476.             _root.model_mc[_loc3_].onRelease = function()
  477.             {
  478.                this.gotoAndStop(1);
  479.                _root.on_clothing11._visible = true;
  480.                _root.on_clothing11 = undefined;
  481.             };
  482.          }
  483.          if(_root.model_mc[_loc3_]._name.substr(0,5) == "jew03")
  484.          {
  485.             _root.model_mc[_loc3_].onRelease = function()
  486.             {
  487.                this.gotoAndStop(1);
  488.                _root.on_clothing12._visible = true;
  489.                _root.on_clothing12 = undefined;
  490.             };
  491.          }
  492.       }
  493.    }
  494. }
  495. function clothing_visible()
  496. {
  497.    var _loc2_ = 1;
  498.    while(_loc2_ < 23)
  499.    {
  500.       _root["on_clothing" + _loc2_]._visible = false;
  501.       _loc2_ = _loc2_ + 1;
  502.    }
  503. }
  504. function sound_ini4()
  505. {
  506.    _root.bg4_sound = new Sound();
  507.    _root.bg4_sound.attachSound("s4");
  508.    _root.bg4_sound.start();
  509.    _root.bg4_sound.setVolume(100);
  510. }
  511. function s1_sd()
  512. {
  513.    _root.bg1_sound = new Sound();
  514.    _root.bg1_sound.attachSound("click");
  515.    _root.bg1_sound.start();
  516.    _root.bg1_sound.setVolume(100);
  517. }
  518. function sound3()
  519. {
  520.    mySound3 = new Sound();
  521.    mySound3.attachSound("s3");
  522.    mySound3.start(0,999);
  523.    mySound3.setVolume(100);
  524. }
  525. function end_btn_sound_fun()
  526. {
  527.    mySound3.stop();
  528. }
  529. function SetPrintJob()
  530. {
  531.    my_pj = new PrintJob();
  532.    my_pj.start();
  533.    my_pj.addPage("_root",{printAsBitmap:true});
  534.    my_pj.send();
  535.    delete my_pj;
  536. }
  537. stop();
  538. mymenu = new ContextMenu();
  539. mymenu.hideBuiltInItems();
  540. mymenu.builtInItems.print = true;
  541. _root.menu = mymenu;
  542. var sd_no = true;
  543. girl(0,0,160);
  544. sd_btn.onRelease = function()
  545. {
  546.    if(sd_no == true)
  547.    {
  548.       end_btn_sound_fun();
  549.       sd_no = false;
  550.    }
  551.    else
  552.    {
  553.       sound3();
  554.       sd_no = true;
  555.    }
  556. };
  557. end_btn_sound_fun();
  558. sound3();
  559. third_ch_ini();
  560. reset_one();
  561. clothing_visible();
  562. make_fun();
  563.